package com.qiaofang.dataprocessing.facade.impl;

import com.qiaofang.common.request.DataRequest;
import com.qiaofang.common.response.DataResultResponse;
import com.qiaofang.dataprocessing.service.FirsthandEstateService;
import com.qiaofang.dataprocessing.service.PropertyService;
import com.qiaofang.dataprocessing.stub.bean.request.FirsthandUpDownProcessingRequest;
import com.qiaofang.dataprocessing.stub.bean.request.PropertyUpDownProcessingRequest;
import com.qiaofang.dataprocessing.stub.facade.UpDownProcessingFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by IDEA.
 *
 * @auther Zym.
 * @company qiaofang
 * @date 2020/11/18 14:03
 */
@RestController
public class UpDownProcessingFacadeImpl implements UpDownProcessingFacade {

    @Autowired
    private FirsthandEstateService firsthandEstateService;

    @Autowired
    private PropertyService propertyService;

    @Override
    public DataResultResponse<List<String>> propertyUuidList(@RequestBody DataRequest<PropertyUpDownProcessingRequest> request) {
        return DataResultResponse.ok(propertyService.getUpPropertyUuidList(request.getParam()));
    }

    @Override
    public DataResultResponse<List<String>> estateUuidList(@RequestBody DataRequest<FirsthandUpDownProcessingRequest> request) {
        return DataResultResponse.ok(firsthandEstateService.getUpEstateUuidList(request.getParam()));
    }
}
